An increasing number of devices used in business and home are controlled by small embedded processors. Generally, these embedded processors are low-cost and include a limited amount of memory or storage for executing applications. Consequently, the applications executed on these embedded processors must also be relatively small and compact.
It is also desirable that these small applications be interoperable with a large class of devices, such as cellular phones, manufactured by different companies. This reduces the cost associated with developing software applications and therefore decreases the overall cost of ownership for the device. For example, cellular phone users should be able to transfer applications to each other and download them into their phone for processing. This would greatly enhance the flexibility and feature set on cellular phones even though the phones may be different models designed by different manufacturers.
A general purpose stack based processor fits these requirements well because stack instructions tend to be small and compact. The general purpose stack based processor includes a stack for storing operands and a stack processor which processes instructions by popping one or more operands off the stack, operating on them, and then pushing the results back on the stack for another instruction to process. Stack based executables are compact because the stack instructions reference operands implicitly on the stack rather than explicitly in the instructions. The storage space saved by not referencing operands such as registers, memory addresses, or immediate values explicitly can be used to store additional stack instructions.
Embedding a general purpose stack based processor in a wide variety of devices is also very cost effective. Compared with RISC (reduced instruction set computer), CISC (complex instruction set computer) processors, or EPIC (Explicitly Parallel Instruction Computer) stack processor research and development costs are relatively low. Stack processors are well understood and relatively simple to design. As discussed above, another part of the cost effectiveness of stack processors is based on developing software that can be shared and used by a wide variety of different devices. By increasing software interoperability between devices, stack based processors can be produced in high volumes with low cost, and yet have high overall profits. For example, software applications consisting of architecturally neutral bytecode instructions can be readily shared when designed for execution on a Java Virtual Machine (JVM) stack based processor such as described in the book, "The Java Virtual Machine Specification" by Tim Lindholm and Frank Yellin, published by Addison-Wesley, 1997. These bytecode instruction based software applications are compact and substantially interoperable with almost any device utilizing, or simulating, a JVM stack based processor.
Unfortunately, typical stack based processors are generally not well suited for high-performance multimedia or other real time processing. This is because stack based processors spend too many machine cycles accessing operands on the stack to perform real-time processing. Further, a stack based processor having multiple functional units can not use them to process information in parallel because the stack must be accessed sequentially. Specifically, only one instruction at a time can pop operands off the top of stack or push results back on to the top of stack. In some cases, instructions are waiting for the stack even though they are not dependent on the results produced by another instruction in the instruction stream. These delays reduce the level of performance a stack based processor with multiple functional units is capable of providing.
What is needed is a method and apparatus for multiple functional units to access the stack of a stack based processor simultaneously and process information in parallel.